import {IModuleConf} from '@wangeditor/editor'
import {renderGapConf} from '@/components/BaseEditor/gapFilling/renderElem.ts'
import {gapToHtmlConf} from '@/components/BaseEditor/gapFilling/elemHtml.ts'
import {parseGapHtmlConf} from '@/components/BaseEditor/gapFilling/parseElemHtml.ts'
import {withGap} from '@/components/BaseEditor/gapFilling/plugs.ts'
import GapMenu from '@/components/BaseEditor/gapFilling/gapFillingBtn.ts'

const gapFillingBtn = {
	key: 'gapFilling', // 定义 menu key ：要保证唯一、不重复（重要）
	factory() {
		return new GapMenu() // 把 `YourMenuClass` 替换为你菜单的 class
	}
}

const gapModule: Partial<IModuleConf> = {
	menus: [gapFillingBtn], // 菜单
	editorPlugin: withGap, // 插件
	renderElems: [renderGapConf], // renderElem
	elemsToHtml: [gapToHtmlConf],  // elemToHtml
	parseElemsHtml: [parseGapHtmlConf] // parseElemHtml
}

export default gapModule
